package com.liyiqing.secondhandmall.memberservice.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.liyiqing.secondhandmall.memberservice.entity.MemberUserStatisticsInfoEntity;
import com.liyiqing.secondhandmall.memberservice.service.MemberUserStatisticsInfoService;
import com.liyiqing.commonservice.utils.PageUtils;
import com.liyiqing.commonservice.utils.R;



/**
 * 账号信息统计
 *
 * @author LiYiQing
 * @email 1570865668@qq.com
 * @date 2022-02-18 22:47:22
 */
@RestController
@RequestMapping("memberservice/memberuserstatisticsinfo")
public class MemberUserStatisticsInfoController {
    @Autowired
    private MemberUserStatisticsInfoService memberUserStatisticsInfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = memberUserStatisticsInfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
		MemberUserStatisticsInfoEntity memberUserStatisticsInfo = memberUserStatisticsInfoService.getById(id);

        return R.ok().put("memberUserStatisticsInfo", memberUserStatisticsInfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody MemberUserStatisticsInfoEntity memberUserStatisticsInfo){
		memberUserStatisticsInfoService.save(memberUserStatisticsInfo);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody MemberUserStatisticsInfoEntity memberUserStatisticsInfo){
		memberUserStatisticsInfoService.updateById(memberUserStatisticsInfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
		memberUserStatisticsInfoService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
